home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
awe2-0_1.lha
/
awe2-0.1
/
Src
/
CpuMuxExceptions.cc
< prev
next >
Wrap
C/C++ Source or Header
|
1990-07-09
|
1KB
|
52 lines
// This may look like C code, but it is really -*- C++ -*-
//
// Copyright (C) 1988 University of Illinois, Urbana, Illinois
// Copyright (C) 1989 University of Colorado, Boulder, Colorado
// Copyright (C) 1990 University of Colorado, Boulder, Colorado
//
// written by Dirk Grunwald (grunwald@foobar.colorado.edu)
//
#include "CpuMuxExceptions.h"
#include "ReserveByException.h"
#include "CpuMultiplexor.h"
#include "SpinBarrier.h"
#include "stream.h"
#include "Thread.h"
void
ExceptionReserve::handleException()
{
if ( toReserve -> reserveByException( ThisCpu -> currentThread ) ) {
ThisCpu -> currentThread = 0;
}
}
void
ExceptionTerminate::handleException()
{
ThisCpu -> currentThread = 0; // do before delete so thread frees stack
delete deadThread;
}
void
ExceptionReschedule::handleException()
{
//
// Switch to another thread when we havenot gotten
// rid of the current one.
//
assert(ThisCpu -> currentThread != 0);
ThisCpu -> add( ThisCpu -> currentThread );
ThisCpu -> currentThread = 0;
}
void
ExceptionIveSuspended::handleException()
{
//
// Switch to another thread when we havenot gotten
// rid of the current one.
//
ThisCpu -> currentThread = 0;
}